#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5+10;
int A[maxn];
typedef struct group{
    set<int> s;
    int h, t;
}G;
int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
    int T; cin >> T;
    while(T--){
        int n, k; cin >> n >> k;
        bool flg;
        for (int i = 0; i < n; ++i) {
            cin >> A[i];
            if(A[i] > k) {flg = false; goto END;}
        }
        set<int> s;
        int p = -1;
        for (int i = 0; i < min(k,n); ++i) {
            if(!s.count(A[i])) s.insert(A[i]);
            else {p = i; break;}
        }
        
        END:
        if(flg) cout << "YES\n";
        else cout << "NO\n";
    }
    return 0;
}